package com.fengye.school.model.school;


import com.fengye.school.model.BaseEntity;
import com.fengye.school.model.school.enums.SexType;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.*;
import java.util.Date;
import java.util.Set;

/**
 * 教职工表
 */
@Table(name = "tb_s_teacher")
@org.hibernate.annotations.Table(appliesTo = "tb_s_teacher", comment = "教职工表")
@Entity
@Getter
@Setter
public class Teacher extends BaseEntity {
    @Column(name = "name", columnDefinition = "varchar(100) COMMENT '教职工姓名'")
    private String name;

    @Column(name = "code", columnDefinition = "varchar(100) COMMENT '教职工编号'")
    private String code;

    @Column(name = "position", columnDefinition = "varchar(100) COMMENT '职位'")
    private String position;

    @Column(name = "sex", columnDefinition = "varchar(100) COMMENT '教职工性别'")
    private SexType sex;

    @Column(name = "age", columnDefinition = "int COMMENT '教职工年龄'")
    private String age;

    @Column(name = "education", columnDefinition = "varchar(100) COMMENT '教职工学历'")
    private String education;

    @Column(name = "entry_time", columnDefinition = "varchar(100) COMMENT '教职工入职时间'")
    private Date entryTime;


    @OneToOne(mappedBy = "teacher", targetEntity = EClass.class)
    private EClass eClass;

    @ManyToMany(mappedBy = "teacherSet", targetEntity = Subject.class)
    private Set<Subject> subjectSet;

}
